﻿<UserControl xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit" 
    x:Class="UI.Common.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation" 
    xmlns:uriMapper="clr-namespace:System.Windows.Navigation;assembly=System.Windows.Controls.Navigation"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:local="clr-namespace:UI.Common"     
    xmlns:converters="clr-namespace:Core.GenericDefinitions.Converters;assembly=Core.GenericDefinitions"
    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480" xmlns:my="clr-namespace:UI.UserControls;assembly=UI.UserControls">
    <UserControl.DataContext>
        <local:MainPageViewModel x:Name="MainPageDataContext"/>
    </UserControl.DataContext>
    <toolkit:BusyIndicator x:Name="ApplicationBusy" IsBusy="{Binding IsApplicationBussy,Mode=TwoWay}" BusyContent="Lütfen Bekleyiniz . . .">
        <Grid x:Name="LayoutRoot" Style="{StaticResource LayoutRootGridStyle}" >
            <Grid.RowDefinitions>
                <RowDefinition Height="65" />
                <RowDefinition Height="25" />
                <RowDefinition Height="25" />
                <RowDefinition Height="350*" />
                <RowDefinition Height="25" />
            </Grid.RowDefinitions>
            <Border x:Name="BannerBorder"
                Grid.Row="0" Grid.RowSpan="1" 
                Margin="0" BorderBrush="{x:Null}" OpacityMask="{x:Null}">
                <Border.Background>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FFC2CAF9" Offset="0" />
                        <GradientStop Color="#FFF8F9FF" Offset="0.208" />
                    </LinearGradientBrush>
                </Border.Background>
                <Grid>
                    <my:EOrganizatorLogo HorizontalAlignment="Left" Margin="7,7,0,0" Name="eOrganizatorLogo1" VerticalAlignment="Top" Width="252" Height="53" MouseLeftButtonDown="eOrganizatorLogo1_MouseLeftButtonDown" />
                    <TextBlock HorizontalAlignment="Right" Width="189" Height="15" Foreground="{StaticResource BodyTextColorBrush}" Text="{Binding Path=WellcomeText}" Margin="0,0,5,2" TextAlignment="Right" VerticalAlignment="Bottom" />

                </Grid>
            </Border>

            <Border x:Name="NavigationBorder"
                Grid.Row="1" Grid.RowSpan="1" Background="{StaticResource HighLightColorBrush}" >
                <Grid>
                    <Canvas HorizontalAlignment="Left" Margin="10,0,0,0">
                        <TextBlock Text="Organizatör" x:Name="lnkOrganizator" Style="{StaticResource MainPageLinkStyle}" HorizontalAlignment="Right" Canvas.Top="3" d:LayoutOverrides="Height, VerticalMargin" MouseLeftButtonDown="lnkOrganizator_MouseLeftButtonDown" />
                        <Border Style="{StaticResource MainPageLinkSeperator}" Canvas.Left="75" Margin="0" Canvas.Top="4" d:LayoutOverrides="Height, VerticalMargin"/>
                        <TextBlock Text="Benim Sayfam" Style="{StaticResource MainPageLinkStyle}" Canvas.Left="82" Canvas.Top="3" MouseLeftButtonDown="TextBlock_MouseLeftButtonDown" />
                    </Canvas>
                    <StackPanel HorizontalAlignment="Right" Margin="0,1,5,1" Width="356" Orientation="Horizontal" FlowDirection="RightToLeft">

                        <HyperlinkButton Content="Kayıt" x:Name="hplSubmit"   Visibility="{Binding Path=LoginPanelVisibility}" VerticalContentAlignment="Center" Foreground="{StaticResource HoverHyperlinkForegroundColorBrush}" FontSize="10" />

                        <HyperlinkButton Content="Çıkış" x:Name="hplCikis"  Command="{Binding Path=LogoutCommand}"  Visibility="{Binding  LogoutButtonVisibility}" VerticalContentAlignment="Center" Foreground="{StaticResource HoverHyperlinkForegroundColorBrush}" FontSize="10" />

                        <HyperlinkButton Content="Giriş" x:Name="hplLogin"  Visibility="{Binding Path=LoginPanelVisibility}"   Command="{Binding Path=LoginCommand}" Margin="1,0" VerticalContentAlignment="Center" Foreground="{StaticResource HoverHyperlinkForegroundColorBrush}" FontSize="10" TabIndex="2" />
                        <PasswordBox Width="54" Height="20" Margin="1,0,3,0"  Visibility="{Binding Path=LoginPanelVisibility}" x:Name="txtPassword" Foreground="Gray" Password="{Binding Path=LoginInfo.Password, Mode=TwoWay}" VerticalContentAlignment="Center" FontSize="9" FlowDirection="LeftToRight" TabIndex="1" />
                        <TextBox x:Name="txtUserName" Height="20"  Visibility="{Binding Path=LoginPanelVisibility}" Text="{Binding Path=LoginInfo.UserName, Mode=TwoWay, BindsDirectlyToSource=True}" Width="82" Foreground="Gray" VerticalContentAlignment="Center" FontSize="9" FlowDirection="LeftToRight" TabIndex="0" />

                    </StackPanel>

                </Grid>
            </Border>

            <Canvas x:Name="InnerLinkCanvas"
                Grid.Row="2" Grid.RowSpan="1">
                <Canvas.Background>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FFC2CAF9" Offset="0" />
                        <GradientStop Color="#FFE8EBFB" Offset="1" />
                        <GradientStop Color="#FFE8EBFB" Offset="0.3" />
                    </LinearGradientBrush>
                </Canvas.Background>
            </Canvas>

            <Border x:Name="ContentBorder" 
               Grid.Row="3">

                <navigation:Frame x:Name="ContentFrame"                            
                              Source="/Home" Navigated="ContentFrame_Navigated" 
                              NavigationFailed="ContentFrame_NavigationFailed" BorderBrush="#FFDFE6F5">
                    <navigation:Frame.UriMapper>
                        <uriMapper:UriMapper>
                            <uriMapper:UriMapping Uri="" MappedUri="/Views/Home.xaml"/>
                            <uriMapper:UriMapping Uri="/{pageName}" MappedUri="/Views/{pageName}.xaml"/>
                            <uriMapper:UriMapping Uri="Organizator" MappedUri="/Views/OrganizatorViews/Organizator.xaml" />
                        </uriMapper:UriMapper>
                    </navigation:Frame.UriMapper>
                </navigation:Frame>
            </Border>

            <Border x:Name="InnerLinkBorder"
                Grid.Row="4" Grid.RowSpan="1">
                <Border.Background>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FFC2CAF9" Offset="0" />
                        <GradientStop Color="#FFE8EBFB" Offset="1" />
                        <GradientStop Color="#FFE8EBFB" Offset="0.3" />
                    </LinearGradientBrush>                    
                </Border.Background>
                
            </Border>

        </Grid>
    </toolkit:BusyIndicator>
</UserControl>